package com.cy.sentinel;

import com.alibaba.csp.sentinel.adapter.spring.webmvc.callback.RequestOriginParser;
import org.springframework.stereotype.Component;
import javax.servlet.http.HttpServletRequest;
@Component
public class DefaultRequestOriginParser  implements RequestOriginParser {
    @Override
    public String parseOrigin(HttpServletRequest httpServletRequest) {
        String origin = httpServletRequest.getParameter("origin");
        return origin;
//        String ip = httpServletRequest.getRemoteAddr();
//        System.out.println("ip:"+ip);
//        return ip;
    }
}
